package com.diaohaiwen.basic.account.controller;

import com.diaohaiwen.basic.account.obj.model.Account;
import com.diaohaiwen.basic.account.service.RegisterService;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 账户注册
 * @author 刁海文
 * @since 2023/7/22 15:27
 * @Remark
 */
@RequestMapping("/register")
public class RegisterController {

    @Resource
    RegisterService registerService;

    /**
     * 添加系统账户表。
     *
     * @param account 系统账户表
     * @return {@code true} 添加成功，{@code false} 添加失败
     */
    @PostMapping
    public Account register(@RequestBody @Validated Account account) {
        return registerService.register(account);
    }


}
